Skip to content

Improvement/traveller handling#71

Open
jorgenosberg wants to merge 4 commits intoOMSA-Open-Mobility-Sales-API:next-versionfrom
entur:improvement/traveller-handling
Open

Improvement/traveller handling#71
jorgenosberg wants to merge 4 commits intoOMSA-Open-Mobility-Sales-API:next-versionfrom
entur:improvement/traveller-handling

Conversation

@jorgenosberg
Copy link
Copy Markdown
Contributor

This PR serves as a PoC for how we could make traveller-handling more dev & tooling-friendly and avoid the previously discussed travellers vs. profiles vs. assets issue in our input schemas.

By designing TravelParty as the top level schema with correct discriminator usage, generators are able to handle the correct subTypes. This means that devs would typically get a TravelParty interface with the correct implementations IndividualTraveller, UserProfile and Asset/TravellingAsset.

This also means input schemas don't need both travellers, profiles and travellingAssets - they can use a unified travelParties array.

Copilot summary:

Schema standardization and consolidation:

  • Replaced all instances of the travellers array with a travelParties array, and updated the referenced schema from individualTraveller/userProfile/travellingAsset to a unified travelParty schema. This change affects multiple request and response objects, ensuring consistency in how groups of travelers are handled. [1] [2] [3]
  • Updated mutation input and output objects to use updatedTravelParty (referencing travelParty) instead of updatedTraveller (which previously allowed several types), further consolidating traveler-related data structures.

Schema extensibility improvements:

  • Added a discriminator property to the travelParty schema, mapping type values to specific subtypes (individualTraveller, userProfile, travellingAsset). This enables polymorphic deserialization and better type safety.

Reference type additions and updates:

  • Introduced new reference types: userProfileReference and simpleAssetReference, and updated relevant schemas to use these instead of generic or previous references. [1] [2] [3] [4] [5]

Add discriminator to travelParty with mapping for individualTraveller,
userProfile, and travellingAsset. Replace separate travellers/profiles/
travellingAssets arrays with single travelParties array in input schemas
and package response. Add explicit type enums to subtypes for correct
code generation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant